package com.hspedu.innerclass;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/1/28
 * @time 16:49
 */
public class AnonymousInnerClass {
    public static void main(String[] args) {
        Computer computer = new Computer();
        computer.work();
    }
}

interface Usb {
    void start();
}

class Computer {
    public void work() {
        Usb phone = new Usb() {
            @Override
            public void start() {
                System.out.println("手机实现了Usb接口");
            }
        };
        phone.start();
        System.out.println(phone.getClass());
    }
}


